package com.ellen.mac.chatdemo.adpter;

import android.util.Log;
import android.view.View;
import android.widget.ImageView;

import com.avos.avoscloud.im.v2.AVIMConversation;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ellen.mac.chatdemo.R;
import com.ellen.mac.chatdemo.model.AllConversation;
import com.ellen.mac.chatdemo.model.Conversation;

import java.util.List;

/**
 * Created by mac on 2017/12/3.
 */

public class ListConversationAdpter extends BaseQuickAdapter<AllConversation, BaseViewHolder> {
    public ListConversationAdpter(int layoutResId, List data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, AllConversation item) {
        helper.setText(R.id.name, item.getConversation().getName()+"");
        helper.setVisible(R.id.tag,true);
        if(item.isSingle()){
           helper.setImageResource(R.id.tag,R.mipmap.default_avatar_icon);
        }else{
            helper.setImageResource(R.id.tag,R.mipmap.group_icon);
        }
        helper.addOnClickListener(R.id.item);
    }
}